package at.ac.tuwien.big.we14.lab2.api.impl;

import at.ac.tuwien.big.we14.lab2.api.Game;
import at.ac.tuwien.big.we14.lab2.api.PlayersStatus;

public class SimplePlayersStatus implements PlayersStatus{
    
    private String[] name;
    private int[] wonRounds;
    private Status[] statusPlayer0;
    private Status[] statusPlayer1;
    private int winner;
    private String url;
    private int roundcount;
    
    public SimplePlayersStatus() {
    	name = new String[2];    	
    	wonRounds = new int[2];
    	roundcount=0;
    }
    
	@Override
	public String getPlayer0Name() {
		return name[0];
	}
	
	@Override
	public String getPlayer1Name() { 
		return name[1];
	}
	
	@Override
	public void setPlayer0Name(String name) {
		this.name[0]=name;
	}
	
	@Override
	public void setPlayer1Name(String name) {
		this.name[1]=name;
	}
	
	@Override
	public int getPlayer0WonRounds() {
		return wonRounds[0];
	}
	
	@Override
	public int getPlayer1WonRounds() {
		return wonRounds[1];
	}
	
	@Override
	public void setPlayer0WonRounds(int num) {
		this.wonRounds[0]=num;
	}
	
	@Override
	public void setPlayer1WonRounds(int num) {
		this.wonRounds[1]=num;
	}
	
	@Override
	public Status[] getPlayer0Status() {
		return statusPlayer0;
	}
	@Override
	public Status[] getPlayer1Status() {
		return statusPlayer1;
	}
	@Override
	public void setPlayer0Status(Status[] status) {
		this.statusPlayer0=status;
	}
	
	@Override
	public void setPlayer1Status(Status[] status) {
		this.statusPlayer1=status;
	}
	
	@Override
	public String getWinner() {
		if(winner<0) return Game.NONE;
		else return name[winner];
	}
	
	@Override
	public void setWinner(int winner) {
		this.winner=winner;
	}
	
	public void setRoundCount(int i) {
		roundcount=i;
	}
	
    public int getRoundCount() {
    	return roundcount;
    }
	
	@Override
	public String getNextPage() { 
		return url;
	}
	
	public void setNextPage(String url) {
		this.url=url;
	}
   
}
